﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace GiaoDien_QLMayMac
{
    public partial class GiaoDienChinh : Form
    {
        public GiaoDienChinh()
        {
            InitializeComponent();
        }

      
        private void GiaoDienChinh_Load(object sender, EventArgs e)
        {
            Form child = new GiaoDien_QLMayMac.GiaoDienGioiThieuCongTy();
            child.MdiParent = this;
            child.Show();
            child.WindowState = FormWindowState.Maximized;
        }
        private void nhanVienQuanLyDathang_Click(object sender, EventArgs e)
        {
            Form child = new GiaoDien_QLMayMac.DatHang();
            child.MdiParent = this;
            child.Show();
            child.WindowState = FormWindowState.Maximized;
        }

        private void heThongDongHetGiaoDien_Click(object sender, EventArgs e)
        {
            Form fParent = GiaoDien_QLMayMac.GiaoDienChinh.ActiveForm;
            foreach (Form mdiChild in fParent.MdiChildren)
                mdiChild.Close();
        }

        
        private void nhanVienGhiBienNhan_Click(object sender, EventArgs e)
        {

            Form child = new GiaoDien_QLMayMac.GiaoDienGioiThieuCongTy();
            child.MdiParent = this;
            child.Show();
            child.WindowState = FormWindowState.Maximized;
        }
        private void nhanVienLapPGH_Click(object sender, EventArgs e)
        {
            Form child = new GiaoDien_QLMayMac.LapPhieuGiaoHang();
            child.MdiParent = this;
            child.Show();
            child.WindowState = FormWindowState.Maximized;
        }
         private void nhanVienLapDSKHgiaoGanNhat_Click(object sender, EventArgs e)
        {
            Form child = new GiaoDien_QLMayMac.LapDSKHGiaoGanNhat();
            child.MdiParent = this;
            child.Show();
            child.WindowState = FormWindowState.Maximized;
        }
        private void hethongKetthuc_Click(object sender, EventArgs e)
        { 
            if( DialogResult.Yes == MessageBox.Show("Tắt chương trình thật sự ?",
                                          "Xac dinh yeu cau",MessageBoxButtons.YesNo,
                                            MessageBoxIcon.Question))
                Application.Exit();
        }

        private void khachHangThongTinCaNhanNhapMoi_Click(object sender, EventArgs e)
        {
            Form fParent = GiaoDien_QLMayMac.GiaoDienChinh.ActiveForm;
            foreach (Form mdiChild in fParent.MdiChildren)
                if(!(mdiChild is GiaoDien_QLMayMac.GiaoDienGioiThieuCongTy))
                    mdiChild.Close();

            Form child = new GiaoDien_QLMayMac.DangXayDung();
            child.MdiParent = this;
            child.Show();
            child.WindowState = FormWindowState.Maximized;
        }

        private void khachHangThongTinCaNhanTraCuu_Click(object sender, EventArgs e)
        {
            Form fParent = GiaoDien_QLMayMac.GiaoDienChinh.ActiveForm;
            foreach (Form mdiChild in fParent.MdiChildren)
                if (!(mdiChild is GiaoDien_QLMayMac.GiaoDienGioiThieuCongTy))
                    mdiChild.Close();

            Form child = new GiaoDien_QLMayMac.DangXayDung();
            child.MdiParent = this;
            child.Show();
            child.WindowState = FormWindowState.Maximized;

        }
        private void khachHangThongTinSoDoNhapMoi_Click(object sender, EventArgs e)
        {
            Form fParent = GiaoDien_QLMayMac.GiaoDienChinh.ActiveForm;
            foreach (Form mdiChild in fParent.MdiChildren)
                if (!(mdiChild is GiaoDien_QLMayMac.GiaoDienGioiThieuCongTy))
                    mdiChild.Close();

            Form child = new GiaoDien_QLMayMac.DangXayDung();
            child.MdiParent = this;
            child.Show();
            child.WindowState = FormWindowState.Maximized;
        }
        private void khachHangThongTinSoDoTraCuu_Click(object sender, EventArgs e)
        {
            Form fParent = GiaoDien_QLMayMac.GiaoDienChinh.ActiveForm;
            foreach (Form mdiChild in fParent.MdiChildren)
                if (!(mdiChild is GiaoDien_QLMayMac.GiaoDienGioiThieuCongTy))
                    mdiChild.Close();

            Form child = new GiaoDien_QLMayMac.DangXayDung();
            child.MdiParent = this;
            child.Show();
            child.WindowState = FormWindowState.Maximized;
        }

              
    }
}